
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>3.1 集群节点的动态增删 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="3.2常见错误与常用配置.html" />
    
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" >
            
                <span>
            
                    
                    第一章 Hadoop环境搭建
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../chapter1/1.1.html">
            
                <a href="../chapter1/1.1.html">
            
                    
                    1.1 安装JDK
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../chapter1/1.2.html">
            
                <a href="../chapter1/1.2.html">
            
                    
                    1.2 Hadoop伪分布式安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../chapter1/1.3.html">
            
                <a href="../chapter1/1.3.html">
            
                    
                    1.3 完全分布式环境搭建
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    第二章 Hadoop高可用
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../chapter2/HadoopHA原理.html">
            
                <a href="../chapter2/HadoopHA原理.html">
            
                    
                    2.1 HadoopHA原理与机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../chapter2/HadoopHA搭建规划.html">
            
                <a href="../chapter2/HadoopHA搭建规划.html">
            
                    
                    2.2 HadoopHA搭建规划 
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../chapter2/Zookeeper介绍.html">
            
                <a href="../chapter2/Zookeeper介绍.html">
            
                    
                    2.3 Zookeeper介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../chapter2/Zookeeper搭建.html">
            
                <a href="../chapter2/Zookeeper搭建.html">
            
                    
                    2.4 Zookeeper配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../chapter2/HadoopHA配置.html">
            
                <a href="../chapter2/HadoopHA配置.html">
            
                    
                    2.5 HadoopHA配置
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" >
            
                <span>
            
                    
                    第三章 动态增删节点与常见配置
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.4.1" data-path="3.1集群节点动态增删.html">
            
                <a href="3.1集群节点动态增删.html">
            
                    
                    3.1 集群节点的动态增删
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="3.2常见错误与常用配置.html">
            
                <a href="3.2常见错误与常用配置.html">
            
                    
                    3.2 常见错误与常用配置
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >3.1 集群节点的动态增删</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="&#x52A8;&#x6001;&#x6DFB;&#x52A0;&#x8282;&#x70B9;">&#x52A8;&#x6001;&#x6DFB;&#x52A0;&#x8282;&#x70B9;</h2>
<h2 id="&#x4FEE;&#x6539;&#x914D;&#x7F6E;&#x6587;&#x4EF6;">&#x4FEE;&#x6539;&#x914D;&#x7F6E;&#x6587;&#x4EF6;</h2>
<h3 id="1-&#x914D;&#x7F6E;slaves3x&#x7684;hadoop&#x662F;workers&#x6587;&#x4EF6;">1. &#x914D;&#x7F6E;slaves(3.X&#x7684;Hadoop&#x662F;workers)&#x6587;&#x4EF6;</h3>
<p>&#x6DFB;&#x52A0;&#x8981;&#x589E;&#x52A0;&#x7684;&#x673A;&#x5668;&#x540D;&#x79F0;&#xFF08;&#x672C;&#x4F8B;&#x4F7F;&#x7528;<code>hadoop-slave4</code>&#xFF09;</p>
<pre><code>hadoop-back
hadoop-slave2
hadoop-slave3
hadoop-slave4
</code></pre><h3 id="2-hosts&#x6587;&#x4EF6;">2. hosts&#x6587;&#x4EF6;</h3>
<p>&#x5728;&#x96C6;&#x7FA4;&#x4E2D;&#x6BCF;&#x53F0;&#x673A;&#x5668;&#x52A0;&#x5165;&#x65B0;&#x673A;&#x5668;&#x7684;ip&#x4E0E;&#x673A;&#x5668;&#x540D;&#x6620;&#x5C04;&#x3002;</p>
<pre><code>192.168.20.101  hadoop-master
192.168.20.102  hadoop-back
192.168.20.103  hadoop-slave2
192.168.20.104  hadoop-slave3
192.168.20.105  hadoop-slave4
</code></pre><h2 id="&#x542F;&#x52A8;datanode">&#x542F;&#x52A8;DataNode</h2>
<pre><code>hadoop-daemon.sh start datanode
yarn-daemon.sh start nodemanager
</code></pre><h2 id="&#x68C0;&#x67E5;&#x65B0;&#x589E;&#x8282;&#x70B9;&#x662F;&#x5426;&#x5DF2;&#x7ECF;live">&#x68C0;&#x67E5;&#x65B0;&#x589E;&#x8282;&#x70B9;&#x662F;&#x5426;&#x5DF2;&#x7ECF;Live</h2>
<p>&#x901A;&#x8FC7;&#x547D;&#x4EE4;&#x53EF;&#x4EE5;&#x67E5;&#x770B;&#x5DF2;&#x7ECF;&#x542F;&#x52A8;&#x7684;&#x8282;&#x70B9;&#xFF1A;</p>
<p><code>yarn node -list</code></p>
<p>&#x4E5F;&#x53EF;&#x901A;&#x8FC7;&#x56FE;&#x5F62;&#x5316;&#x754C;&#x9762;&#x67E5;&#x770B;:</p>
<p><a href="http://ipaddr:50070" target="_blank">http://ipaddr:50070</a></p>
<p>2.X&#x7AEF;&#x53E3;&#x53F7;&#x4E3A;50070,3.X&#x7AEF;&#x53E3;&#x53F7;&#x4E3A;9870.</p>
<h2 id="&#x6D4B;&#x8BD5;&#x521B;&#x5EFA;&#x6587;&#x4EF6;">&#x6D4B;&#x8BD5;&#x521B;&#x5EFA;&#x6587;&#x4EF6;</h2>
<p>&#x6D4B;&#x8BD5;&#x4E00;&#x4E0B;&#x521B;&#x5EFA;&#x65B0;&#x7684;&#x6587;&#x4EF6;&#x65F6;&#x662F;&#x5426;&#x80FD;&#x96C6;&#x6210;&#x65B0;&#x7684;&#x5907;&#x4EFD;&#x7CFB;&#x6570;</p>
<pre><code>hdfs hadoop fs -copyFromLocal mysql-connector-java-5.1.22.tar.gz /test
hdfs hadoop fs -lsr /test
</code></pre><h2 id="&#x5BF9;hdfs&#x4E2D;&#x7684;&#x6587;&#x4EF6;&#x8FDB;&#x884C;&#x8D1F;&#x8F7D;&#x5747;&#x8861;">&#x5BF9;HDFS&#x4E2D;&#x7684;&#x6587;&#x4EF6;&#x8FDB;&#x884C;&#x8D1F;&#x8F7D;&#x5747;&#x8861;</h2>
<p><code>hdfs hadoop balancer</code></p>
<h1 id="&#x52A8;&#x6001;&#x5220;&#x9664;&#x8282;&#x70B9;">&#x52A8;&#x6001;&#x5220;&#x9664;&#x8282;&#x70B9;</h1>
<h2 id="&#x914D;&#x7F6E;&#x6587;&#x4EF6;">&#x914D;&#x7F6E;&#x6587;&#x4EF6;</h2>
<p><code>core-site.xml</code></p>
<pre><code>&lt;property&gt;
&lt;name&gt;dfs.hosts.exclude&lt;/name&gt;
&lt;value&gt;/usr/hadoop/conf/exclude&lt;/value&gt;
&lt;/property&gt;
</code></pre><p><code>hdfs-site.xml</code></p>
<pre><code>&lt;property&gt;
&lt;name&gt;dfs.hosts.exclude&lt;/name&gt;
&lt;value&gt;/usr/hadoop/conf/exclude&lt;/value&gt;
&lt;/property&gt;
</code></pre><p>&#x521B;&#x5EFA;<code>/usr/hadoop/conf/exclude</code></p>
<p>&#x5728;<code>exclude</code>&#x6DFB;&#x52A0;&#x8981;&#x5220;&#x9664;&#x7684;&#x8282;&#x70B9;&#xFF1A;</p>
<pre><code>hadoop-slave4
</code></pre><blockquote>
<p>&#x5220;&#x9664;&#x8282;&#x70B9;&#x65F6;&#x8981;&#x6CE8;&#x610F;&#x5907;&#x4EFD;&#x7CFB;&#x6570;&#xFF0C;Hadoop&#x9ED8;&#x8BA4;&#x7684;&#x6570;&#x503C;&#x662F;3&#xFF0C;&#x901A;&#x5E38;&#x5907;&#x4EFD;&#x7CFB;&#x6570;&#x4E0D;&#x9700;&#x8981;&#x592A;&#x9AD8;&#xFF0C;&#x53EF;&#x4EE5;&#x662F;&#x670D;&#x52A1;&#x5668;&#x603B;&#x91CF;&#x7684;1/3&#x5DE6;&#x53F3;&#x5373;&#x53EF;&#xFF0C;&#x5907;&#x4EFD;&#x7CFB;&#x6570;&#x6700;&#x597D;&#x4E0D;&#x8981;&#x4E0E;&#x8282;&#x70B9;&#x6570;&#x76F8;&#x540C;&#x3002;</p>
</blockquote>
<h2 id="&#x5237;&#x65B0;&#x914D;&#x7F6E;">&#x5237;&#x65B0;&#x914D;&#x7F6E;</h2>
<p><code>hadoop dfsadmin -refreshNodes</code></p>
<h2 id="&#x68C0;&#x67E5;&#x8282;&#x70B9;&#x72B6;&#x6001;">&#x68C0;&#x67E5;&#x8282;&#x70B9;&#x72B6;&#x6001;</h2>
<p>&#x5728;web&#x7AD9;&#x70B9;&#x68C0;&#x67E5;&#x8282;&#x70B9;&#x7684;&#x5904;&#x7406;&#x72B6;&#x6001;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                
                <a href="3.2常见错误与常用配置.html" class="navigation navigation-next navigation-unique" aria-label="Next page: 3.2 常见错误与常用配置">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"3.1 集群节点的动态增删","level":"1.4.1","depth":2,"next":{"title":"3.2 常见错误与常用配置","level":"1.4.2","depth":2,"path":"chapter3/3.2常见错误与常用配置.md","ref":"chapter3/3.2常见错误与常用配置.md","articles":[]},"previous":{"title":"第三章 动态增删节点与常见配置","level":"1.4","depth":1,"ref":"","articles":[{"title":"3.1 集群节点的动态增删","level":"1.4.1","depth":2,"path":"chapter3/3.1集群节点动态增删.md","ref":"chapter3/3.1集群节点动态增删.md","articles":[]},{"title":"3.2 常见错误与常用配置","level":"1.4.2","depth":2,"path":"chapter3/3.2常见错误与常用配置.md","ref":"chapter3/3.2常见错误与常用配置.md","articles":[]}]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"chapter3/3.1集群节点动态增删.md","mtime":"2019-05-06T16:09:44.731Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-06T16:09:52.649Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

